home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / sd-26.zip / database.doc < prev    next >
Encoding:
Text File  |  1992-09-09  |  61.0 KB  |  1,556 lines

  1. The setups that the program recognizes are as follows
  2. (from database.h, enumeration type "setup_kind"), each is
  3. shown with a map giving the person numbering:
  4.  
  5.              _____
  6.             |     |
  7. 1x1         |  0  |                    (4 way symmetry)
  8.             |_____|
  9.  
  10.  
  11.              _____ _____
  12.             |     |     |
  13. 1x2         |  0  |  1  |
  14.             |_____|_____|
  15.  
  16.  
  17.              _____ _____ _____
  18.             |     |     |     |
  19. 1x3         |  0  |  1  |  2  |
  20.             |_____|_____|_____|
  21.  
  22.  
  23.              _____ _____ _____ _____
  24.             |     |     |     |     |
  25. 1x4         |  0  |  1  |  3  |  2  |
  26.             |_____|_____|_____|_____|
  27.  
  28.  
  29.              _____ _____ _____ _____ _____ _____
  30.             |     |     |     |     |     |     |
  31. 1x6         |  0  |  1  |  2  |  5  |  4  |  3  |
  32.             |_____|_____|_____|_____|_____|_____|
  33.  
  34.  
  35.              _____ _____ _____ _____ _____ _____ _____ _____
  36.             |     |     |     |     |     |     |     |     |
  37. 1x8         |  0  |  1  |  3  |  2  |  6  |  7  |  5  |  4  |
  38.             |_____|_____|_____|_____|_____|_____|_____|_____|
  39.  
  40.              _____ _____
  41.             |     |     |
  42.             |  0  |  1  |
  43. 2x2         |_____|_____|              (4 way symmetry)
  44.             |     |     |
  45.             |  3  |  2  |
  46.             |_____|_____|
  47.  
  48.  
  49.              _____ _____ _____
  50.             |     |     |     |
  51.             |  0  |  1  |  2  |
  52. 2x3         |_____|_____|_____|
  53.             |     |     |     |
  54.             |  5  |  4  |  3  |
  55.             |_____|_____|_____|
  56.  
  57.  
  58.              _____ _____ _____ _____
  59.             |     |     |     |     |
  60.             |  0  |  1  |  2  |  3  |
  61. 2x4         |_____|_____|_____|_____|
  62.             |     |     |     |     |
  63.             |  7  |  6  |  5  |  4  |
  64.             |_____|_____|_____|_____|
  65.  
  66.  
  67.              _____ _____ _____ _____ _____ _____
  68.             |     |     |     |     |     |     |
  69.             |  0  |  1  |  2  |  3  |  4  |  5  |
  70. 2x6         |_____|_____|_____|_____|_____|_____|
  71.             |     |     |     |     |     |     |
  72.             | 11  | 10  |  9  |  8  |  7  |  6  |
  73.             |_____|_____|_____|_____|_____|_____|
  74.  
  75.  
  76.              _____ _____ _____ _____ _____ _____ _____ _____
  77.             |     |     |     |     |     |     |     |     |
  78.             |  0  |  1  |  2  |  3  |  4  |  5  |  6  |  7  |
  79. 2x8         |_____|_____|_____|_____|_____|_____|_____|_____|
  80.             |     |     |     |     |     |     |     |     |
  81.             | 15  | 14  | 13  | 12  | 11  | 10  |  9  |  8  |
  82.             |_____|_____|_____|_____|_____|_____|_____|_____|
  83.  
  84.                    _____
  85.              _____|     |_____
  86.             |     |  1  |     |
  87. dmd         |  0  |_____|  2  |
  88.             |_____|     |_____|
  89.                   |  3  |
  90.                   |_____|
  91.  
  92.  
  93.                    _____
  94.                   |     |
  95.                   |  1  |
  96.              _____|_____|_____
  97.             |     |     |     |
  98. star        |  0  |     |  2  |        (4 way symmetry)
  99.             |_____|_____|_____|
  100.                   |     |
  101.                   |  3  |
  102.                   |_____|
  103.  
  104.  
  105.              _____             _____
  106.             |     |_____ _____|     |
  107.             |  0  |     |     |  1  |
  108. bone6       |_____|  5  |  2  |_____|
  109.             |     |_____|_____|     |
  110.             |  4  |           |  3  |
  111.             |_____|           |_____|
  112.  
  113.  
  114.                 _____
  115.                |     |
  116.                |  1  |
  117.              __|__ __|__
  118.             |     |     |
  119.             |  0  |  2  |
  120. short6      |_____|_____|
  121.             |     |     |
  122.             |  5  |  3  |
  123.             |_____|_____|
  124.                |     |
  125.                |  4  |
  126.                |_____|
  127.  
  128.  
  129.                    _____ _____
  130.                   |     |     |
  131.                   |  0  |  1  |
  132.              _____|_____|_____|_____
  133.             |     |     |     |     |
  134. qtag        |  6  |  7  |  3  |  2  |
  135.             |_____|_____|_____|_____|
  136.                   |     |     |
  137.                   |  5  |  4  |
  138.                   |_____|_____|
  139.  
  140.              _____                         _____
  141.             |     |_____ _____ _____ _____|     |
  142.             |  0  |     |     |     |     |  1  |
  143. bone        |_____|  6  |  7  |  3  |  2  |_____|
  144.             |     |_____|_____|_____|_____|     |
  145.             |  5  |                       |  4  |
  146.             |_____|                       |_____|
  147.  
  148.  
  149.                          _____ _____
  150.              _____ _____|     |     |_____ _____
  151.             |     |     |  0  |  1  |     |     |
  152. rigger      |  6  |  7  |_____|_____|  3  |  2  |
  153.             |_____|_____|     |     |_____|_____|
  154.                         |  5  |  4  |
  155.                         |_____|_____|
  156.  
  157.  
  158.                    _____ _____ _____
  159.              _____|     |     |     |_____
  160.             |     |  0  |  1  |  2  |     |
  161. spindle     |  7  |_____|_____|_____|  3  |
  162.             |_____|     |     |     |_____|
  163.                   |  6  |  5  |  4  |
  164.                   |_____|_____|_____|
  165.  
  166.  
  167.                 _____ _____
  168.                |     |     |
  169.                |  0  |  1  |
  170.                |_____|_____|
  171.              _____|     |_____
  172.             |     |  3  |     |
  173. hrglass     |  6  |_____|  2  |
  174.             |_____|     |_____|
  175.                   |  7  |
  176.                 __|__ __|__
  177.                |     |     |
  178.                |  5  |  4  |
  179.                |_____|_____|
  180.  
  181.  
  182.                               _____
  183.                              |     |
  184.                              |  2  |
  185.                              |_____|
  186.              _____ _____     |     |     _____ _____
  187.             |     |     |    |  3  |    |     |     |
  188. crosswave   |  0  |  1  |    |_____|    |  5  |  4  |
  189.             |_____|_____|    |     |    |_____|_____|
  190.                              |  7  |
  191.                              |_____|
  192.                              |     |
  193.                              |  6  |
  194.                              |_____|
  195.  
  196.              _____ _____ _____ _____
  197.             |     |     |     |     |
  198.             |  0  |  1  |  2  |  3  |
  199.             |_____|_____|_____|_____|
  200.             |     |     |     |     |
  201. 3x4         | 10  | 11  |  5  |  4  |
  202.             |_____|_____|_____|_____|
  203.             |     |     |     |     |
  204.             |  9  |  8  |  7  |  6  |
  205.             |_____|_____|_____|_____|
  206.  
  207.  
  208.              _____ _____ _____ _____
  209.             |     |     |     |     |
  210.             | 12  | 13  | 14  |  0  |
  211.             |_____|_____|_____|_____|
  212.             |     |     |     |     |
  213.             | 10  | 15  |  3  |  1  |
  214. 4x4         |_____|_____|_____|_____|            (4 way symmetry)
  215.             |     |     |     |     |
  216.             |  9  | 11  |  7  |  2  |
  217.             |_____|_____|_____|_____|
  218.             |     |     |     |     |
  219.             |  8  |  6  |  5  |  4  |
  220.             |_____|_____|_____|_____|
  221.  
  222.  
  223.              _____ _____ _____ _____ _____ _____
  224.             |     |     |     |     |     |     |
  225.             |  0  |  1  |  2  |  3  |  4  |  5  |
  226.             |_____|_____|_____|_____|_____|_____|
  227.             |     |     |     |     |     |     |
  228.             | 11  | 10  |  9  |  8  |  7  |  6  |
  229. 4x6         |_____|_____|_____|_____|_____|_____|
  230.             |     |     |     |     |     |     |
  231.             | 18  | 19  | 20  | 21  | 22  | 23  |
  232.             |_____|_____|_____|_____|_____|_____|
  233.             |     |     |     |     |     |     |
  234.             | 17  | 16  | 15  | 14  | 13  | 12  |
  235.             |_____|_____|_____|_____|_____|_____|
  236.  
  237.                    _____             _____
  238.                   |     |           |     |
  239.                   |  1  |           |  4  |
  240.              _____|_____|_____ _____|_____|_____
  241.             |     |     |     |     |     |     |
  242.             |  0  |     |  2  |  7  |     |  5  |
  243.             |_____|_____|_____|_____|_____|_____|
  244.                   |     |           |     |
  245.                   |  3  |           |  6  |
  246. c1phan            |_____|           |_____|         (4 way symmetry)
  247.                   |     |           |     |
  248.                   | 14  |           | 11  |
  249.              _____|_____|___________|_____|_____
  250.             |     |     |     |     |     |     |
  251.             | 13  |     | 15  | 10  |     |  8  |
  252.             |_____|_____|_____|_____|_____|_____|
  253.                   |     |           |     |
  254.                   | 12  |           |  9  |
  255.                   |_____|           |_____|
  256.  
  257.  
  258.                          _____ _____
  259.                         |     |     |
  260.                         |  0  |  1  |
  261.                    _____|_____|_____|_____
  262.                   |     |     |     |     |
  263.                   | 21  | 22  |  2  |  3  |
  264.              _____|_____|_____|_____|_____|_____
  265.             |     |     |     |     |     |     |
  266.             | 19  | 20  | 23  |  5  |  4  |  6  |
  267. bigblob     |_____|_____|_____|_____|_____|_____|      (4 way symmetry)
  268.             |     |     |     |     |     |     |
  269.             | 18  | 16  | 17  | 11  |  8  |  7  |
  270.             |_____|_____|_____|_____|_____|_____|
  271.                   |     |     |     |     |
  272.                   | 15  | 14  | 10  |  9  |
  273.                   |_____|_____|_____|_____|
  274.                         |     |     |
  275.                         | 13  | 12  |
  276.                         |_____|_____|
  277.  
  278.  
  279.                       _____
  280.                      |     |
  281.                      |  2  |
  282.                    __|__ __|__
  283.              _____|     |     |_____
  284.             |     |  1  |  3  |     |
  285. galaxy      |  0  |_____|_____|  4  |     (4 way symmetry)
  286.             |_____|     |     |_____|
  287.                   |  7  |  5  |
  288.                   |_____|_____|
  289.                      |     |
  290.                      |  6  |
  291.                      |_____|
  292.  
  293.                    _____             _____
  294.              _____|     |_____ _____|     |_____
  295.             |     |  1  |     |     |  7  |     |
  296. ptpd        |  0  |_____|  2  |  6  |_____|  4  |
  297.             |_____|     |_____|_____|     |_____|
  298.                   |  3  |           |  5  |
  299.                   |_____|           |_____|
  300.  
  301.  
  302.                             _____
  303.                            |     |
  304.                            |  3  |
  305.              _____ _____ __|__ __|__ _____ _____
  306.             |     |     |     |     |     |     |
  307. 3x1dmd      |  0  |  1  |  2  |  6  |  5  |  4  |
  308.             |_____|_____|_____|_____|_____|_____|
  309.                            |     |
  310.                            |  7  |
  311.                            |_____|
  312.  
  313.  
  314.                 _____       _____       _____
  315.                |     |     |     |     |     |
  316.                |  0  |     |  1  |     |  2  |
  317.              __|__ __|__ __|__ __|__ __|__ __|__
  318.             |     |     |     |     |     |     |
  319. 3dmd        |  9  | 10  | 11  |  5  |  4  |  3  |
  320.             |_____|_____|_____|_____|_____|_____|
  321.                |     |     |     |     |     |
  322.                |  8  |     |  7  |     |  6  |
  323.                |_____|     |_____|     |_____|
  324.  
  325.  
  326.                 _____       _____       _____       _____
  327.                |     |     |     |     |     |     |     |
  328.                |  0  |     |  1  |     |  2  |     |  3  |
  329.              __|__ __|__ __|__ __|__ __|__ __|__ __|__ __|__
  330.             |     |     |     |     |     |     |     |     |
  331. 4dmd        | 12  | 13  | 14  | 15  |  7  |  6  |  5  |  4  |
  332.             |_____|_____|_____|_____|_____|_____|_____|_____|
  333.                |     |     |     |     |     |     |     |
  334.                | 11  |     | 10  |     |  9  |     |  8  |
  335.                |_____|     |_____|     |_____|     |_____|
  336.  
  337.  
  338.  
  339.  
  340.                                _____
  341.                               |     |
  342.                               |  3  |
  343.              _____ _____ _____|_____|_____ _____ _____
  344.             |     |     |     |     |     |     |     |
  345. wingedstar  |  0  |  1  |  2  |     |  6  |  5  |  4  |
  346.             |_____|_____|_____|_____|_____|_____|_____|
  347.                               |     |
  348.                               |  7  |
  349.                               |_____|
  350.  
  351.  
  352.  
  353.                          _____
  354.                _____    |     |    _____
  355.               |     |   |  3  |   |     |
  356.               |  2  |   |_____|   |  5  |
  357.               |_____|   |     |   |_____|
  358.                         |  4  |
  359.              _____ _____|_____|_____ _____
  360.             |     |     |     |     |     |
  361. hyperglass  |  0  |  1  |     |  7  |  6  |      (4 way symmetry)
  362.             |_____|_____|_____|_____|_____|
  363.                         |     |
  364.                _____    | 10  |    _____
  365.               |     |   |_____|   |     |
  366.               | 11  |   |     |   |  8  |
  367.               |_____|   |  9  |   |_____|
  368.                         |_____|
  369.  
  370.  
  371.              _____ _____
  372.             |     |     |
  373.             |  1  |  2  |
  374. trngl       |_____|_____|      (1 way symmetry -- leads to strange
  375.                |     |         requirements in call descriptions)
  376.                |  0  |
  377.                |_____|
  378.  
  379.  
  380.  
  381. thar
  382. nothing            ??????
  383. normal_concentric  ??????
  384.  
  385.  
  386. An important property of these setups, used extensively by the program,
  387. is that any person's diagonal opposite can be found by adding half the
  388. setup size modulo the setup size.  Additionally, for setups that have
  389. 4 way symmetry, the person 90 degrees clockwise from a given person can
  390. be found by adding one quarter of the setup size modulo the setup size.
  391.  
  392. Before going further, we must distinguish between
  393. a "beginning setup kind" and an "ending setup kind".
  394. These are described internally by the enumerations "begin_kind" and
  395. "setup_kind", respectively, in the file database.h, by the way.
  396.  
  397. Ending setup kinds correspond to the diagrams shown earlier.  They do
  398. not distinguish between 90 degree rotated versions of the same setup.
  399. Beginning setup kinds are more numerous because they DO distinguish
  400. between the 90 degree rotated versions of those setups that do not
  401. have 4 way symmetry.  That is, they take into account the difference
  402. between lines and columns, so that a call definition can indicate
  403. separate actions for people in lines vs. people in columns in the
  404. same 2x4 setup.
  405.  
  406. The set of beginning setup kinds is just the set of ending setup kinds
  407. (that is, the diagrams above) augmented by 90 degree rotated versions
  408. of those setups that don't have 4 way symmetry.  The names of these
  409. extra setups (called "PU" setups) are typically formed by reversing
  410. the matrix size numbers (1x4 vs. 4x1, for example) or by putting
  411. the letter "p" in front, as in "pqtag".
  412.  
  413. The extra beginning setup kinds are as follows:
  414.  
  415.            normal setup           "PU" setup
  416.  
  417.                 1x2                  2x1
  418.                 dmd                  pmd
  419.                 trngl                ptrngl
  420.                 bone6                pbone6
  421.                 short6               pshort6
  422.                 qtag                 pqtag
  423.                 wing                 pwing
  424.                 spindle              pspindle
  425.                 hrglass              phrglass
  426.                 1x4                  4x1
  427.                 1x8                  8x1
  428.                 2x4                  4x2
  429.                 2x3                  3x2
  430.                 1x6                  6x1
  431.                 3x4                  4x3
  432.                 2x6                  6x2
  433.                 2x8                  8x2
  434.                 ptpd                 pptpd
  435.                 3x1dmd               p3x1dmd
  436.                 3dmd                 p3dmd
  437.                 4dmd                 p4dmd
  438.  
  439. This correspondence is embodied in the program by means of the table
  440. "keytab" in the file sdtables.c, by the way.
  441.  
  442. A call definition by array consists of one or more descriptors that look like:
  443.  
  444.          setup <beginning setup kind> <ending setup kind>
  445.             array [<person action> <person action> ...]
  446.  
  447. So, for example, the description of the call "drift apart" looks as follows:
  448.  
  449.    setup 2x4 2x4
  450.       array [M6S M4S M7S M5S L2S L0S R3S R1S]
  451.    setup 4x2 2x4
  452.       array [R6S M4N 3LS M5S M2S R4S M3N L1S]
  453.  
  454. The first descriptor tells people who think they are in lines what to do,
  455. and the second descriptor addresses people in columns.  For calls that start
  456. in a setup with 4 way symmetry, there is only one descriptor as in the
  457. following definition of "reach out":
  458.  
  459.    setup 2x2 1x4
  460.       array [M3S M1S R2S L0S]
  461.  
  462. It is never appropriate for a PU setup, such as "4x2", to
  463. appear as the SECOND token after the word "setup".  Only the FIRST token
  464. may be such a setup.
  465.  
  466. An entry of zero in the array means that the call would be illegal for
  467. anyone in that position, e.g. the leaders in the call "right and left thru".
  468.  
  469. We can now show the interpretation of a call descriptor for a very simple case,
  470. when the beginning and ending formations are both in normal orientation,
  471. as shown in diagrams above.  In this case the beginning setup will have the
  472. same name as an ending setup.  The list in brackets will have as many items
  473. as there are people in the beginning setup.  Each person finds his position
  474. number in that setup, assuming he is facing north.  It is as though everyone
  475. were given the diagrams listed above, and held the diagram in front of him
  476. to determine his position.  Once he determines his position, he looks at that
  477. item in the bracketed array (starting with zero, of course) to determine
  478. what to do.  The number says what position in the ending setup that person
  479. should move to.  The letter (N, E, S, or W) after the number tells what
  480. facing direction to take (north, east, south, or west).  Both of these are
  481. interpreted relative to the diagram that the person is holding in front of him.
  482. So, for example, a direction of north indicates that that person does not
  483. change facing direction, east indicates that that person finishes 90 degrees
  484. clockwise from his starting orientation, and so on.  Note that all directions
  485. are north for the call "walk and dodge", and are south for the call "reach
  486. out".  This is so even if the calls are done from T-boned formations.
  487.  
  488. Finally, the optional letter before the number tells that person's roll
  489. direction.  "L" and "R" indicate that the person will quarter left or
  490. right if told to roll after the call.  "M" ("middle") says that the
  491. person knows that he can't roll, and will stay facing the same direction.
  492. No letter means that the person's roll direction is undefined
  493. (or controversial, or not implemented yet) and an error will be given if
  494. that person is told to roll.  For example, roll is considered illegal
  495. after "wheel fan and cross thru".
  496.  
  497. Example:
  498.      In "reach out", the first array item, which is "M3S", says that any
  499. person in the starting 2x2 box who is a lead beau (position 0 in the
  500. diagram) should think of a 1x4 line elongated laterally relative to himself,
  501. and should go to the second spot from the right end (position 3), turn 180
  502. degrees, and refuse to roll.
  503.  
  504.       This person ---+
  505.                      |
  506.                      |
  507.                    __V__ _____
  508.                   |     |     |
  509.                   |  0  |     |
  510.                   |_____|_____|
  511.                   |     |     |
  512.                   |     |     |
  513.                   |_____|_____|
  514.  
  515.           goes here -------+
  516.                            |
  517.                            |
  518.              _____ _____ __V__ _____
  519.             |     |     |     |     |
  520.             |     |     |  3  |     |
  521.             |_____|_____|_____|_____|
  522.  
  523. If people are T-boned, the application of these rules could result in
  524. people fighting over which way the resulting 1x4 should be oriented.
  525. The program will resolve this by turning the result into a diamond if
  526. it can, or giving an error otherwise.
  527.  
  528. We will now go through all the cases in a somewhat methodical way.
  529.  
  530.             BEGINNING AND ENDING SETUPS DO NOT HAVE 4 WAY SYMMETRY,
  531.                         CALL IS NON-ROTATING
  532.  
  533.    We consider a call to be non-rotating if the starting and ending setups
  534.    have consistent orientation relative to the diagrams above.  That is,
  535.    if the beginning setup is oriented as shown in one of the diagrams,
  536.    the ending setup will also be as shown in one of the diagrams.  Any
  537.    "non-shape-changer" is such a call.  Switch to a diamond is also
  538.    non-rotating.  Reverse flip the diamond is not.
  539.  
  540. In this case, each person holds the diagram in front of him, in normal
  541. orientation if possible, so that he is facing north, and reads his
  542. position number from it.  He then looks that the correspondingly numbered
  543. element of the array describing the call in the database, and goes to
  544. the indicated spot in the result setup, using the same orientation
  545. of the set of diagrams.  For example, on the call "circulate" from a 2x4,
  546. anyone who thinks he is in lines and is the second from the left looking
  547. out, will do this:
  548.  
  549.       This person ---+
  550.                      |
  551.                      |
  552.              _____ __V__ _____ _____
  553.             |     |     |     |     |
  554.             |     |  1  |     |     |
  555.             |_____|_____|_____|_____|
  556.             |     |     |     |     |
  557.             |     |     |     |     |
  558.             |_____|_____|_____|_____|
  559.  
  560.       looks at item number 1 in the call definition array, which is
  561.             setup 2x4 2x4
  562.                array [R3S R2S L1S L0S M3N M2N M1N M0N]
  563.                            ^
  564.                            |
  565.                         item 1
  566.  
  567.       and so goes here ----+
  568.                            |
  569.                            |
  570.              _____ _____ __V__ _____
  571.             |     |     |     |     |
  572.             |     |     |  2  |     |
  573.             |_____|_____|_____|_____|
  574.             |     |     |     |     |
  575.             |     |     |     |     |
  576.             |_____|_____|_____|_____|
  577.  
  578.       and faces south, ready to roll right.
  579.  
  580. The procedure just described only works for people who are facing north
  581. or south in the diagram of the beginning setup.  People facing east
  582. or west do the following:  Change the name of the beginning setup to
  583. its PU name (in this case 4x2) when looking it up in the database
  584. specification, and turn all the diagrams 90 degrees counterclockwise.
  585.  
  586. The PU version of the 2x4 setup looks like this:
  587.              _____ _____
  588.             |     |     |
  589.             |  3  |  4  |
  590.             |_____|_____|
  591.             |     |     |
  592.             |  2  |  5  |
  593. 4x2         |_____|_____|
  594.             |     |     |
  595.             |  1  |  6  |
  596.             |_____|_____|
  597.             |     |     |
  598.             |  0  |  7  |
  599.             |_____|_____|
  600.  
  601. If someone is last in a right-hand column, he will do the following:
  602.  
  603.                          _____ _____
  604.                         |     |     |
  605.                         |     |     |
  606.                         |_____|_____|
  607.                         |     |     |
  608.                         |     |     |
  609.                         |_____|_____|
  610.                         |     |     |
  611.                         |     |     |
  612.                         |_____|_____|
  613.                         |     |     |
  614.       this person ----->|  0  |     |
  615.                         |_____|_____|
  616.  
  617.       looks at item number 0 in the call definition array, which is
  618.             setup 4x2 2x4
  619.                array [M1N M2N M3N R4S L3S M4N M5N M6N]
  620.       (Note that the beginning setup is now 4x2, but the ending setup
  621.          is still 2x4.  PU names are never used in ending setup names.)
  622.  
  623.                             _____ _____
  624.                            |     |     |
  625.                            |     |     |
  626.                            |_____|_____|
  627.                            |     |     |
  628.                            |     |     |
  629.                            |_____|_____|
  630.                            |     |     |
  631.       and so goes here --->|  1  |     |
  632.                            |_____|_____|
  633.                            |     |     |
  634.                            |     |     |
  635.                            |_____|_____|
  636.  
  637.  
  638.       and faces north, ready to refuse to roll.
  639.  
  640.  
  641.  
  642. Calls that can handle arbitrary facing directions from beginning setups that
  643. do not have 4 way symmetry must have 2 entries in the database: a "normal"
  644. one for people who are facing north or south in the diagrams shown above,
  645. and a "PU" one for people who are facing east or west.  The full
  646. definition for circulate from arbitrary 2x4's is
  647.  
  648.    setup 2x4 2x4
  649.       array [R3S R2S L1S L0S M3N M2N M1N M0N]
  650.    setup 4x2 2x4
  651.       array [M1N M2N M3N R4S L3S M4N M5N M6N]
  652.  
  653. When using the PU definition, both the beginning and ending diagrams
  654. are rotated 90 degrees counterclockwise relative to the above diagrams,
  655. whether they are the same setup or different setups.
  656.  
  657. Another example:
  658.  
  659. Diamonds always have people T-boned.  The points use the normal
  660. definitions and the centers use the PU definitions.  The call
  661. "diamond circulate" is defined as
  662.  
  663.    setup dmd dmd
  664.       array [R1E 0 L1W 0]
  665.    setup pmd dmd
  666.       array [0 R2E 0 L2W]
  667.  
  668. The zero entries mean that the call is illegal for people who
  669. are facing directly into or out of the diamond.  The legal starting
  670. positions for the call "diamond single rotate" are the other way around:
  671.  
  672.    setup dmd dmd
  673.       array [0 L0S 0 L2N]
  674.    setup pmd dmd
  675.       array [L3N 0 L1S 0]
  676.  
  677. The diagram that people use for the PU definition is:
  678.                 _____
  679.                |     |
  680.                |  2  |
  681.              __|__ __|__
  682.             |     |     |
  683.             |  1  |  3  |
  684.             |_____|_____|
  685.                |     |
  686.                |  0  |
  687.                |_____|
  688.  
  689.  
  690. Another example:
  691. The call "flip the diamond" is defined as
  692.  
  693.    setup dmd 1x4
  694.       array [R1S 0 L3S 0]
  695.    setup pmd 1x4
  696.       array [0 R2E 0 L2W]
  697.  
  698. The centers of the diamond use the PU definition.  They
  699. rotate the ending diagram 90 degrees counterclockwise also,
  700. so the ending setup is
  701.  
  702.              _____
  703.             |     |
  704.             |  2  |
  705.             |_____|
  706.             |     |
  707.             |  3  |
  708.             |_____|
  709.             |     |
  710.             |  1  |
  711.             |_____|
  712.             |     |
  713.             |  0  |
  714.             |_____|
  715.  
  716.  
  717.             BEGINNING AND ENDING SETUPS DO NOT HAVE 4 WAY SYMMETRY,
  718.                         CALL IS *ROTATING*
  719.  
  720. If the beginning and ending setups do not both appear in the above diagrams
  721. with consistent orientation, do the following:
  722.  
  723.    Invent a new call whose action is the desired call followed by
  724.       a complete rotation of the final poition 90 degrees counterclockwise.
  725.    Enter that new call in the database as described above.
  726.    Put the word "rotate" after the two setup names in each definition
  727.       specification.
  728.  
  729. The word "rotate" tells the program to rotate the setup resulting from the
  730. use of that specification clockwise after completion of the call.  The call
  731. "counter rotate" is an example:
  732.  
  733.    setup 2x4 2x4 rotate
  734.       array [R0N R1N L6S L7S L0S L1S R6N R7N]
  735.    setup 4x2 2x4 rotate
  736.       array [R0N R1N R2N R3N L0S L1S L2S L3S]
  737.  
  738. "Lockit" is another:
  739.  
  740.    setup 1x4 1x4 rotate
  741.       array [R0N R1N L0S L1S]
  742.  
  743. "Single strut right" is another:
  744.  
  745.    setup 4x1 1x4 rotate
  746.       array [3W 2E 0 0]
  747.  
  748. Rotating call definitions are confusing to write!  The facing direction
  749. given in the call specification does NOT include the final clockwise
  750. rotation that the program will perform.  In "lockit" person #0 is shown
  751. not changing his facing direction at all ("N") even though his roll direction
  752. is "R".  This is because his actual 90 degree clockwise turn is entirely
  753. a consequence of the hidden final rotation.  Person #2 is show turning
  754. 180 degrees.  That, plus the final rotation, gives a 90 degree
  755. counterclockwise turn.
  756.  
  757. What happens if one of the specifications has the word "rotate" and the
  758. other does not?  If people are not T-boned, there is no problem.  Only
  759. one of the specifications is used.  In this case, whether the call is a
  760. shape-changer would depend on people's facing direction.  (The call "change
  761. your image" comes to mind.)  If people are T-boned, the call will be illegal
  762. with this definition.  "Change your image" used to be definied this way,
  763. and was illegal from T-boned setups.  It now uses a different trick, to
  764. be described much later.
  765.  
  766.             BEGINNING AND ENDING SETUPS BOTH HAVE 4 WAY SYMMETRY
  767.  
  768. This is straightforward.  The word "rotate" is never used with such
  769. calls, and only one descriptor is required.  If people are T-boned when
  770. the call is executed, the program does what it can.  Here is the definition
  771. of "ripoff":
  772.  
  773.    setup 2x2 2x2
  774.       array [R1S R2N M3N M0N]
  775.  
  776.  
  777.             BEGINNING SETUP HAS 4 WAY SYMMETRY, ENDING SETUP DOES NOT
  778.  
  779. If the ending setup, relative to people who are facing north when the call
  780. begins, is oriented as in one of the diagrams above, the situation is
  781. straightforward, as in "reach out":
  782.  
  783.    setup 2x2 1x4
  784.       array [M3S M1S R2S L0S]
  785.  
  786. Otherwise, we must use a rotating definition.  As above, we define
  787. a new call that has the effect of the desired call followed by a 90
  788. degree counterclockwise rotation, encode that into the database, and put
  789. in the word "rotate".  Here is "pass the ocean":
  790.  
  791.    setup 2x2 1x4 rotate
  792.       array [0 0 L1S R0N]
  793.  
  794.                    _____ _____
  795.                   |     |     |
  796.                   |     |     |
  797.                   |_____|_____|
  798.                   |     |     |
  799.                   |  3  |     |
  800.                   |_____|_____|
  801.                      ^
  802.                      |
  803.       This person ---+
  804.  
  805.  
  806.       goes here --+        and faces north,
  807.                   |
  808.                   |
  809.                 __V__ _____ _____ _____
  810.                |     |     |     |     |
  811.                |  0  |     |     |     |
  812.                |_____|_____|_____|_____|
  813.  
  814. and then the entire setup is rotated clockwise, resulting in this:
  815.  
  816.              _____
  817.             |     |
  818.             |  X  |    facing east
  819.             |_____|
  820.             |     |
  821.             |     |
  822.             |_____|
  823.             |     |
  824.             |     |
  825.             |_____|
  826.             |     |
  827.             |     |
  828.             |_____|
  829.  
  830. which is of course the desired result.
  831.  
  832.             BEGINNING SETUP DOES NOT HAVE 4 WAY SYMMETRY
  833.                      ENDING SETUP DOES
  834.  
  835. If the beginning setup, relative to people who are facing north,
  836. is oriented as in one of the diagrams above, the situation is
  837. straightforward, as in "ah so":
  838.  
  839.    setup 1x4 2x2
  840.       array [R1S L3S L0S R2S]
  841.  
  842. If the PU beginning setup is required, so that we turn all the
  843. diagrams counterclockwise, we turn the ending setup's diagram
  844. counterclockwise also.  This is perhaps not intuitive.
  845. Here is the call "single polly wally":
  846.  
  847.    setup 4x1 2x2
  848.       array [R3S 2N L1S 0S]
  849.  
  850. beginning PU setup:
  851.              _____
  852.             |     |
  853.             |  2  |
  854.             |_____|
  855.             |     |
  856.             |  3  |
  857.             |_____|
  858.             |     |
  859.             |  1  |
  860.             |_____|
  861.             |     |
  862.             |  0  |
  863.             |_____|
  864.  
  865.  
  866. ending setup -- note that it is rotated with respect to the main
  867.    diagram for a 2x2, so that its orientation is consistent with
  868.    the 4x1 starting setup:
  869.  
  870.              _____ _____
  871.             |     |     |
  872.             |  1  |  2  |
  873.             |_____|_____|
  874.             |     |     |
  875.             |  0  |  3  |
  876.             |_____|_____|
  877.  
  878. Viewed in this way, person zero goes to position 3 and faces south.
  879. The word "rotate" is not used with such a specification, since the
  880. orientations of the beginning and ending setups are consistent
  881. WITH EACH OTHER.  (They are both rotated 90 degrees counterclockwise
  882. from the main diagrams.)
  883.  
  884. We can of course mix specifications in which the people begin in the
  885. normal setup and the PU setup.  Consider "drop in":
  886.  
  887.    setup dmd 2x2
  888.       array [R0E 0 L1W 0]
  889.    setup pmd 2x2
  890.       array [0 M1N 0 M2N]
  891.  
  892. For the "normal" people (who are the points):
  893.  
  894.           _____                _____ _____
  895.     _____|     |_____         |     |     |
  896.    |     |  1  |     |        |  0  |  1  |
  897.    |  0  |_____|  2  |  -->   |_____|_____|
  898.    |_____|     |_____|        |     |     |
  899.          |  3  |              |  3  |  2  |
  900.          |_____|              |_____|_____|
  901.  
  902. For the "PU" people (who are the centers):
  903.  
  904.           _____
  905.          |     |
  906.          |  2  |               _____ _____
  907.        __|__ __|__            |     |     |
  908.       |     |     |           |  1  |  2  |
  909.       |  1  |  3  |     -->   |_____|_____|
  910.       |_____|_____|           |     |     |
  911.          |     |              |  0  |  3  |
  912.          |  0  |              |_____|_____|
  913.          |_____|
  914.  
  915. The word "rotate" is not used for either the "dmd" or the "pmd"
  916. specification.
  917.  
  918. General rules of thumb:
  919.  
  920.    (1) Never use the word "rotate" with an ending setup that has
  921.       4-way symmetry.  If you think you need to, you are wrong.
  922.    (2) In general, use the word "rotate" for both specifications of a
  923.       multi-specification call, or for neither.  If it is used for
  924.       one and not the other, that means that, if people are T-boned,
  925.       they will disagree on whether the call is a shape-changer.  The
  926.       only legal case of this is calls with an ending setup which is
  927.       a 2x4.  In that case, if people are T-boned, the call will go
  928.       into a 4x4 final setup.  This is used in "change your image"
  929.       and "single rotate".
  930.    (3) The word "rotate" simply causes all of the people to turn their
  931.       formation 90 degrees clockwise at the conclusion of the call.
  932.       It is independent of everything else.
  933.    (3) Within any one specification, you must either turn ALL of the
  934.       above diagrams counterclockwise, or NONE of them.  In the former
  935.       case, use the "PU" starting setup designation for that
  936.       specification.  If you can't define the call this way, define
  937.       a different call and use "rotate" to get the desired behavior.
  938.  
  939.                 MULTIPLE SPECIFICATIONS
  940.  
  941. In general, a call is defined with one or more specifications, each
  942. giving the rule for one starting setup.  An example of this can be
  943. found in the call "counter rotate", for which a very abbreviated
  944. definition is:
  945.  
  946.    setup 2x4 2x4 rotate
  947.       array [R0N R1N L6S L7S L0S L1S R6N R7N]
  948.    setup 4x2 2x4 rotate
  949.       array [R0N R1N R2N R3N L0S L1S L2S L3S]
  950.    setup 2x2 2x2
  951.       array [R1E L0W L1W R0E]
  952.    setup dmd dmd rotate
  953.       array [R0N 0 L0S 0]
  954.    setup pmd dmd rotate
  955.       array [0 R1N 0 L1S]
  956.  
  957. It actually has a specification for just about every starting setup
  958. that exists.  This is because counter rotate is a rather unusual call.
  959. Many calls have just one definition from one setup.  They are legal
  960. from other setups that are just multiple copies of the given setup.
  961. For example, "circle to a wave" is just defined from a 2x2 box:
  962.  
  963.    setup 2x2 2x2
  964.       array [0 0 0E 1E]
  965.  
  966. No other definitions are given.  When the call is executed from a
  967. larger setup, such as lines facing or an 8-chain, the program breaks
  968. up the larger setup into smaller ones and executes the call separately
  969. in each smaller setup.
  970.  
  971. The program's general rule is to search through the given call
  972. definition for a specification matching the given setup.  If no entry
  973. is found, it attempts to divide the setup into smaller ones.  (If
  974. people are T-boned and the setup does not have 4-way symmetry, it
  975. actually requires two specifications, for example, 2x4 and 4x2.
  976. If it finds either one, it does not consider subdividing.  If only
  977. one of the two was present, the people whoe require the other will
  978. lose.  Too bad.)
  979.  
  980. When the program decides to subdivide the setup, it is guided by the
  981. specifications that are present for smaller setups.  It always begins
  982. with the least radical subdivision.  If the original setup is a 2x4,
  983. but no 2x4 (or 4x2, as needed) specifications are present, it looks
  984. for 1x4 (and/or 4x1) specifications.  If found, the setup is divided
  985. that way.  If a 2x2 specification is found, it divides the setup that
  986. way.  If both are found, it gives precedence to the 1x4 division.
  987. If neither a 1x4/4x1 or 2x2 specification is found, it looks for a
  988. 1x2 and/or 2x1.  If found, it subdivides the setup as appropriate.
  989. If no 1x2/2x1 is found, it searches for a 1x1.  Similar subdivision
  990. searches are performed for other initial setups.
  991.  
  992. Some of the subdivision rules are actually somewhat tricky.  When
  993. dividing a 2x2 into 1x2's, it looks at people's facing direction
  994. and checks for the existence of a 1x2 and/or 2x1 specification.
  995. It requires an unambiguous decision of which axis to use for the
  996. subdivision.  Hence "siamese breakdown" is not permitted in a 2x2,
  997. and subdivision is not possible if people are T-boned (I think.)
  998. Similar care is exercised in the 2x4 to 1x2/2x1 subdivision.  It
  999. does the right thing with "heads pass thru; everyone trade".
  1000.  
  1001. The reason that "counter rotate" needs so many specifications is that
  1002. this call's definition does not involve the replication of smaller
  1003. versions in larger setups.  If it were defined on a 1x4 but not on a
  1004. 1x8, then, if called from a grand wave, it would do a lockit on each
  1005. side, rather than a the gigantic concentric counter rotate that is
  1006. required.
  1007.  
  1008. The order in which specifications with different starting setups
  1009. appear is not significant -- the search is always from the largest
  1010. setup to the smallest.  Multiple specifications with the same
  1011. starting setup are only meaningful if qualifiers are used (see below),
  1012. and, in that case, they are searched in the order in which they appear.
  1013.  
  1014.         OVERVIEW OF PREDICATES, RESTRICTIONS, AND QUALIFIERS
  1015.  
  1016. These are conditional things that can be placed in calls to perform
  1017. special functions.  A brief summary of their meanings is this:
  1018.  
  1019.    Predicates are applied separately to each person, and are used
  1020.    to let a person execute a rule that depends on some property of
  1021.    the setup, such as another person's orientation.  Example:
  1022.    Predicates are used in the call "in roll circulate" to tell people
  1023.    who are not inrollers where the inroller is, so they know which way
  1024.    to move.
  1025.  
  1026.    Restrictions are applied to entire setups, and are used to indicate
  1027.    that, while the overall setup shape is acceptable, certain aspects
  1028.    (for example, facing directions) might be unusual.  When a restriction
  1029.    is violated, a warning or error arises.  This is typically the "do
  1030.    your part" warning.  Example:  A restriction is used on "follow your
  1031.    neighbor" to force the "do your part" warning if people are not in
  1032.    a normal box.  The call could be done from a magic box.  [Actually,
  1033.    most restrictions should raise errors instead of warnings, but the
  1034.    ability to do that is a recent feature.]
  1035.  
  1036.    Qualifiers are used to control the search for starting setups.
  1037.    Rather than causing a warning or error to be raised if the setup
  1038.    is inappropriate, a qualifier simply causes that clause to be skipped
  1039.    in the search.  An example of this is in the call "recycle":
  1040.  
  1041.       setup 1x4 2x2 qualifier wave_only
  1042.          .....
  1043.       setup 2x2 1x4
  1044.          .....
  1045.  
  1046.    When done from a 2x4, we want to do the 1x4 version if the people
  1047.    are in waves, and the 2x2 version if they are in lines facing.  The
  1048.    normal preference is for the 1x4 version.  The qualifier causes the
  1049.    program to look at people's facing direction and ignore the 1x4 clause
  1050.    if the people are not in waves.  This will cause the 2x2 clause to be
  1051.    used instead.  If they are neither in waves nor lines facing, the 2x2
  1052.    clause will be used and the call will fail, since the 2x2 definition
  1053.    requires facing couples.
  1054.  
  1055. In using predicates, restrictions, and qualifiers, one must be aware
  1056. of their behavior in the presence of phantoms.  Some of them are
  1057. strict -- they require that all necessary people actually be present
  1058. and make up the indicated formation.  Others are lax -- they simply
  1059. require that the people who are present be oriented in a way that is
  1060. consistent with the indicated formation.  In general, predicates are
  1061. strict (though they typically only look at one other person, not the
  1062. whole setup), and restrictions and qualifiers are lax.
  1063.  
  1064.                   PREDICATES
  1065.  
  1066. Predicates are used to indicate, on a person-by-person basis, how
  1067. the call definition is determined by properties of the setup other
  1068. than that person's position and facing direction.  If a person's
  1069. action is dependent only on his position and facing direction, as
  1070. it is for most calls, the mechanism already described is sufficient.
  1071. For calls like "cycle and wheel" and "in roll circulate", that isn't
  1072. enough.  Some people need guidance from another person.
  1073.  
  1074. Predicates are used by replacing the "array" clause:
  1075.  
  1076.             array [<person action> <person action> ...]
  1077.  
  1078. With a "preds" clause:
  1079.  
  1080.       preds <error message in quotes>
  1081.          if <predicate> [<person action> <person action> ...]
  1082.          if <predicate> [<person action> <person action> ...]
  1083.          ....
  1084.  
  1085. For each person, the predicates are evaluated in sequence until one
  1086. is satisfied.  When that happens, that person's entry in the
  1087. corresponding action list is used.  If no predicate is satisfied for
  1088. some person, the call fails, giving the error message.  (In some
  1089. cases, evaluation of a predicate itself gives rise to an error
  1090. message.)
  1091.  
  1092. For example, the call "cycle and wheel" is defined this way:
  1093.  
  1094.    setup 1x4 2x2
  1095.       preds "Can't do this call."
  1096.          if lines_miniwave [R1S L3N L0S R2N]
  1097.          if lines_couple   [R1S R0S L0S L1S]
  1098.  
  1099. These two predicates are both strict, and both defined for many setups.
  1100. They test the "partner" of the given person, and return true if that
  1101. partner is facing the opposite way or same way, respectively, as the
  1102. given person.  If the partner is a phantom or is T-boned to the given
  1103. person, they return false.  They do not raise any errors in any case.
  1104. If any person's partner is a phantom or is T-boned, both predicates
  1105. will return false, the program will run out of predicates, and the
  1106. error "Can't do this call" will be raised.
  1107.  
  1108. The call could have been defined by:
  1109.  
  1110.    setup 1x4 2x2
  1111.       preds "?"
  1112.          if lines_miniwave [R1S L3N L0S R2N]
  1113.          if lines_couple   [R1S R0S L0S L1S]
  1114.          if always         [R1S  0  L0S  0 ]
  1115.  
  1116. since the ends know what to do anyway.  In this case, if an end were
  1117. a phantom and the adjacent center were not, the call would fail with
  1118. a "so-and-so is not able to execute this call" error.  This is because,
  1119. when testing the center, the first two predicates would both fail, and
  1120. the third would be used, giving zero, which indicates that the person
  1121. can't do the call.
  1122.  
  1123. The definition of "in roll circulate" is:
  1124.  
  1125.    setup 2x4 2x4
  1126.       preds "???"
  1127.          if inroller_is_cw [1S 2S 3S 0  0  6S 7S 0N]
  1128.          if always         [0  0S 1S 2S 3N 4S 5S 0 ]
  1129.  
  1130. The predicate "inroller_is_cw" is unusual.  It is specifically
  1131. designed for this call.  It is defined only for 2x4 lines.
  1132. Some predicates, like "lines_miniwave" and "lines_couple", are
  1133. overloaded -- they have rather general meaning and can be invoked
  1134. from several setups.  This predicate, however, is only appropriate
  1135. from 2x4 lines, so it must only be used with a "setup 2x4 ..."
  1136. specification.  (In fact, it is only used for this call.)
  1137. Always check the applicable setups before using a predicate.
  1138.  
  1139. The predicate "inroller_is_cw" does most of its work when evaluated
  1140. for a center person (spots 1, 2, 5, or 6.)  It examines the people
  1141. at the two ends of that person's line.  There must be exactly one
  1142. live inroller.  An inroller at one end and a phantom at the other
  1143. is legal.  It evaluates to true if the inroller is clockwise (around
  1144. the 2x4) from the person in question, false if not.  In the latter
  1145. case, the program will use the "always" predicate, which is always
  1146. satisfied, so it will never run off the end of the list.  For this
  1147. reason, the error message after the word "preds" is just some question
  1148. marks -- it will never be printed.  If the in-roll direction can not
  1149. be determined, the predicate itself raises the error.
  1150.  
  1151. For the ends, the in-roll status is clear.  Person zero is not an
  1152. inroller.  The predicate checks whether the person at the other end
  1153. of his line is an inroller, raising an error if not, and returns true
  1154. if so, since that inroller is clockwise from person zero.  For person
  1155. three, the inroller must be at the other end of the line, which is
  1156. counterclockwise, so the predicate either raises an error or returns
  1157. false.  Appropriate things are also done with persons four and seven,
  1158. to be sure that the inroller is not ambiguous.
  1159.  
  1160. To summarize some general properties of predicates:
  1161.  
  1162.    (1) Some predicates are "strict" in their examination of other
  1163.        people.  They demand that the person being examined be alive
  1164.        and facing in a certain direction.  A few predicates are "lax" --
  1165.        they only test for the absence of a person facing in the incorrect
  1166.        direction.  Always check the documentation of the spefic predicate
  1167.        being used.
  1168.    (2) Some predicates are applicable on a number of setups, with
  1169.        suitable interpretation of what is meant for each setup.  Others
  1170.        are only applicable to one setup.  Always check the documentation
  1171.        of the spefic predicate being used.
  1172.    (3) Some predicates (the more "generic" ones, in general) do their work
  1173.        only by returning TRUE or FALSE.  They never raise errors, because
  1174.        that would compromise their generality.  Other predicates raise
  1175.        errors when appropriate, in order to simplify the database.  Always
  1176.        check the documentation of the specific predicate being used.
  1177.  
  1178. The existing predicates are listed in the appendix.
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.                            APPENDIX A -- PREDICATES
  1185.  
  1186. always
  1187.       applies to any setup.  Returns TRUE in all cases.
  1188.  
  1189. x22_miniwave
  1190.       applies to 2x2 only.  Returns TRUE if the lateral partner of the
  1191.       person under test is alive and facing the opposite direction.
  1192.       Returns FALSE if the lateral partner is a phantom or faces the
  1193.       same way or is T-boned.
  1194.  
  1195. x22_couple
  1196.       applies to 2x2 only.  Returns TRUE if the lateral partner of the
  1197.       person under test is alive and facing the same direction.  Returns
  1198.       FALSE if the lateral partner is a phantom or faces the opposite way
  1199.       or is T-boned.
  1200.  
  1201. x22_facing_someone
  1202.       applies to 2x2 only.  Returns TRUE if the vertical partner of the
  1203.       person under test is alive and facing the opposite direction.
  1204.       Returns FALSE if the vertical partner is a phantom or faces the
  1205.       same way or is T-boned.  The name may be misleading.  It is intended
  1206.       to be used to determine if the person being tested is facing someone
  1207.       else's face, but, if the two people are back-to-back, the predicate
  1208.       will also be satisfied.  To get the desired effect, you must only
  1209.       use it on people who are trailers.
  1210.  
  1211. x14_once_rem_miniwave
  1212.       applies to 1x4 only.  Returns TRUE if the person once-removed
  1213.       from the person under test is alive and facing the opposite direction.
  1214.       Returns FALSE if the once-removed person is a phantom or faces the
  1215.       same way or is T-boned.
  1216.  
  1217. x14_once_rem_couple
  1218.       applies to 1x4 only.  Returns TRUE if the person once-removed
  1219.       from the person under test is alive and facing the same direction.
  1220.       Returns FALSE if the once-removed person is a phantom or faces the
  1221.       opposite way or is T-boned.
  1222.  
  1223. lines_miniwave
  1224.       applies to 1x2, 1x4, 1x6, 2x4, 2x6, or 2x8 lines only.  Returns TRUE if the
  1225.       lateral partner of the person under test is alive and facing the
  1226.       opposite direction.  Returns FALSE if the partner is a phantom or
  1227.       faces the same way or is T-boned.
  1228.  
  1229. lines_couple
  1230.       applies to 1x2, 1x4, 1x6, 2x4, 2x6, or 2x8 lines only.  Returns TRUE if the
  1231.       lateral partner of the person under test is alive and facing the
  1232.       same direction.  Returns FALSE if the partner is a phantom or
  1233.       faces the opposite way or is T-boned.
  1234.  
  1235. lines_magic_miniwave
  1236.       applies to 2x4 lines only.  Returns TRUE if the magic partner
  1237.       of the person under test (the person in the opposite corner of
  1238.       the same box) is alive and facing the opposite direction.
  1239.       Returns FALSE if the magic partner is a phantom or faces the same
  1240.       way or is T-boned.
  1241.  
  1242. lines_magic_couple
  1243.       applies to 2x4 lines only.  Returns TRUE if the magic partner
  1244.       of the person under test (the person in the opposite corner of
  1245.       the same box) is alive and facing the same direction.
  1246.       Returns FALSE if the magic partner is a phantom or faces the
  1247.       opposite way or is T-boned.
  1248.  
  1249. lines_once_rem_miniwave
  1250.       applies to 2x4 lines only.  This is the same as
  1251.       "x14_once_rem_miniwave", but used in a 2x4 setup.
  1252.  
  1253. lines_once_rem_couple
  1254.       applies to 2x4 lines only.  This is the same as
  1255.       "x14_once_rem_couple", but used in a 2x4 setup.
  1256.  
  1257. lines_tandem
  1258.       applies to 2x4 lines only.  Returns TRUE if the vertical partner
  1259.       of the person under test is alive and facing the same direction.
  1260.       Returns FALSE if the vertical partner is a phantom or faces the
  1261.       opposite way or is T-boned.
  1262.  
  1263. lines_antitandem
  1264.       applies to 2x4 lines only.  Returns TRUE if the vertical partner
  1265.       of the person under test is alive and facing the opposite direction.
  1266.       Returns FALSE if the vertical partner is a phantom or faces the
  1267.       same way or is T-boned.
  1268.  
  1269. columns_tandem
  1270.       applies to 2x1, 4x1, 6x1, 4x2, 6x2, or 8x2 columns only.  Returns TRUE if the
  1271.       tandem partner of the person under test is alive and facing the same
  1272.       direction.  Returns FALSE if that person is a phantom or faces the
  1273.       opposite way or is T-boned.
  1274.  
  1275. columns_antitandem
  1276.       applies to 2x1, 4x1, 6x1, 4x2, 6x2, or 8x2 columns only.  Returns TRUE if the
  1277.       tandem partner of the person under test is alive and facing the opposite
  1278.       direction.  Returns FALSE if that person is a phantom or faces the
  1279.       same way or is T-boned.
  1280.  
  1281. columns_magic_tandem
  1282.       applies to 4x2 columns only.  Returns TRUE if the magic tandem
  1283.       partner of the person under test (the person in the opposite
  1284.       corner of the same box) is alive and facing the same direction.
  1285.       Returns FALSE if that person is a phantom or faces the
  1286.       opposite way or is T-boned.
  1287.  
  1288. columns_magic_antitandem
  1289.       applies to 4x2 columns only.  Returns TRUE if the magic tandem
  1290.       partner of the person under test (the person in the opposite
  1291.       corner of the same box) is alive and facing the opposite direction.
  1292.       Returns FALSE if that person is a phantom or faces the same
  1293.       way or is T-boned.
  1294.  
  1295. columns_once_rem_tandem
  1296.       applies to 4x2 columns only.  Returns TRUE if the person
  1297.       once-removed from the person under test is alive and facing
  1298.       the same direction.  Returns FALSE if that person is a phantom
  1299.       or faces the opposite way or is T-boned.
  1300.  
  1301. columns_once_rem_antitandem
  1302.       applies to 4x2 columns only.  Returns TRUE if the person
  1303.       once-removed from the person under test is alive and facing
  1304.       the opposite direction.  Returns FALSE if that person is a
  1305.       phantom or faces the same way or is T-boned.
  1306.  
  1307. columns_couple
  1308.       applies to 4x2 columns only.  Returns TRUE if the lateral partner
  1309.       of the person under test is alive and facing the same direction.
  1310.       Returns FALSE if that person is a phantom or faces the opposite
  1311.       way or is T-boned.
  1312.  
  1313. columns_miniwave
  1314.       applies to 4x2 columns only.  Returns TRUE if the lateral partner
  1315.       of the person under test is alive and facing the opposite direction.
  1316.       Returns FALSE if that person is a phantom or faces the same way
  1317.       or is T-boned.
  1318.  
  1319. 1x2_beau_or_miniwave
  1320.       applies to 1x2 lines only.  Returns TRUE if this person is a beau,
  1321.       or else this belle is in a miniwave with the other person.
  1322.       Returns FALSE if this belle is in a couple with the other person.
  1323.       Raises an error if this belle can't tell.
  1324.  
  1325.  
  1326.  
  1327. Still to do:
  1328.  
  1329. 1x4_wheel_and_deal_1
  1330. 1x4_wheel_and_deal_2
  1331. vert1
  1332. vert2
  1333. inner_active_lines
  1334. outer_active_lines
  1335.  
  1336.  
  1337.  
  1338. judge_is_right
  1339.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1340.       of the line to this person's right is alive and is a "judge" (extreme
  1341.       right end of the line), and it is not the case that the other end
  1342.       of the line is occupied by another live judge.  Returns FALSE otherwise.
  1343.  
  1344. judge_is_left
  1345.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1346.       of the line to this person's left is alive and is a "judge" (extreme
  1347.       right end of the line), and it is not the case that the other end
  1348.       of the line is occupied by another live judge.  Returns FALSE otherwise.
  1349.  
  1350. socker_is_right
  1351.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1352.       of the line to this person's right is alive and is a "socker" (extreme
  1353.       left end of the line), and it is not the case that the other end
  1354.       of the line is occupied by another live socker.  Returns FALSE otherwise.
  1355.  
  1356. socker_is_left
  1357.       applies to 1x4 lines only.  Returns TRUE if the person on the end
  1358.       of the line to this person's left is alive and is a "socker" (extreme
  1359.       left end of the line), and it is not the case that the other end
  1360.       of the line is occupied by another live socker.  Returns FALSE otherwise.
  1361.  
  1362. inroller_is_cw
  1363.       applies to 2x4 lines only.  Returns TRUE if the end of the line clockwise
  1364.       from this person is a live inroller (facing in) and the other end of that
  1365.       line is not occupied by another live inroller.  Returns FALSE if the end
  1366.       of the line counterclockwise from this person is a live inroller and the
  1367.       other end of that line is not occupied by another live inroller.
  1368.       Otherwise, raises an error.
  1369.  
  1370. magic_inroller_is_cw
  1371.       applies to 2x4 lines only.  Same as inroller_is_cw, but applies to this
  1372.       person's magic line.
  1373.  
  1374. outroller_is_cw
  1375.       applies to 2x4 lines only.  Same as inroller_is_cw, but checks for live
  1376.       outrollers.
  1377.  
  1378. ******* why is there no magic_outroller_is_cw ??????
  1379.  
  1380. outposter_is_cw
  1381.       applies to 2x4 lines only.  Returns TRUE if the end of the line clockwise
  1382.       from this person is the outposter.  The rules for outposters are different
  1383.       from the rules for outrollers:  if both ends of the line are looking out,
  1384.       the one on the right (the "judge") is the outposter -- there is no conflict.
  1385.       Returns FALSE if the outposter is at the counterclockwise end of the line,
  1386.       or there is no live outposter.
  1387.  
  1388. outposter_is_ccw
  1389.       applies to 2x4 lines only.  Returns TRUE if the end of the line counterclockwise
  1390.       from this person is the outposter.  Returns FALSE if the outposter is at the
  1391.       clockwise end of the line, or there is no live outposter.
  1392.  
  1393. Still to do:
  1394.  
  1395. nexttrnglspot_is_tboned
  1396.       applies to triangles only.  This is intended to determine which way a
  1397.       person should face after doing a triangle circulate.  Returns FALSE if
  1398.       this person is a base and will still be a base after circulating,
  1399.       independently of the existence or facing direction of the person already
  1400.       standing on the target spot.  If this person is a base circulating to an
  1401.       apex spot or vice-versa, it demands that there be a person already standing
  1402.       on the target spot.  It returns TRUE if that person is facing perpendicular
  1403.       to the subject person, and FALSE if that person is facing the same way or
  1404.       opposite way.  It returns an error if a triangle circulate is impossible
  1405.       for the subject, or if there is no person on the target spot and such a
  1406.       person is needed.
  1407.  
  1408. next62spot_is_tboned
  1409.       applies to short6 only.  This is intended to determine which way a
  1410.       person should face after doing the outsides part of a 6x2 acey-deucey.
  1411.       Returns FALSE if this person is in the box of 4 (normally, one of the
  1412.       diamond points for 6x2 acey-deucey), whether this person will circulate
  1413.       to an apex (end of the center line for 6x2 acey-deucey) spot or not.
  1414.       If this person is an apex, it demands that there be a person already
  1415.       standing on the target spot.  It returns TRUE if that person is facing
  1416.       perpendicular to the subject person, and FALSE if that person is facing
  1417.       the same way or opposite way.  It returns an error if an outer 6 circulate
  1418.       is impossible for the subject (this can only happen if the subject is an
  1419.       apex), or if there is no person on the target spot and such a person
  1420.       is needed.
  1421.  
  1422. next_magic62spot_is_tboned
  1423.       applies to short6 only.  This is the same as "next62spot_is_tboned",
  1424.       but it uses the "magic 6x2 acey deucey" circulate path in calculating
  1425.       the target spot.
  1426.  
  1427.  
  1428. next_galaxyspot_is_tboned
  1429. column_double_down
  1430.  
  1431.  
  1432.  
  1433. boyp
  1434.       applies to any setup.  Returns TRUE if this person is an unambiguous boy.
  1435.       Returns FALSE if not.  The person's gender is ambiguous if the "as couples"
  1436.       or "tandem" concept has caused people of opposite gender to be paired.
  1437.  
  1438. girlp
  1439.       applies to any setup.  Returns TRUE if this person is an unambiguous girl.
  1440.       Returns FALSE if not.  The person's gender is ambiguous if the "as couples"
  1441.       or "tandem" concept has caused people of opposite gender to be paired.
  1442.  
  1443. roll_is_cw
  1444.       applies to any setup.  Returns TRUE if this person's roll direction, from
  1445.       the preceding call, is clockwise.  Returns if the direction is
  1446.       counterclockwise, or the person can't roll, or roll direction from the
  1447.       preceding call is ill-defined.
  1448.  
  1449. roll_is_ccw
  1450.       applies to any setup.  Returns TRUE if this person's roll direction, from
  1451.       the preceding call, is counterclockwise.  Returns if the direction is
  1452.       clockwise, or the person can't roll, or roll direction from the
  1453.       preceding call is ill-defined.
  1454.  
  1455. x12_boy_facing_girl
  1456.       applies to 2x1 columns only.  Returns TRUE if this person is an
  1457.       unambiguous boy, and the other person in the column is alive and an
  1458.       unambiguous girl.  Facing directions are not checked.
  1459.  
  1460. x12_girl_facing_boy
  1461.       applies to 2x1 columns only.  Returns TRUE if this person is an
  1462.       unambiguous girl, and the other person in the column is alive and an
  1463.       unambiguous boy.  Facing directions are not checked.
  1464.  
  1465. x22_boy_facing_girl
  1466.       applies to 2x2 boxes only.  Returns TRUE if this person is an
  1467.       unambiguous boy, and the person in the box that this person faces
  1468.       is alive and an unambiguous girl.  The facing direction of that other
  1469.       person is not checked.
  1470.  
  1471. x22_girl_facing_boy
  1472.       applies to 2x2 boxes only.  Returns TRUE if this person is an
  1473.       unambiguous girl, and the person in the box that this person faces
  1474.       is alive and an unambiguous boy.  The facing direction of that other
  1475.       person is not checked.
  1476.  
  1477. dmd_ctrs_rh
  1478.       applies to a diamond or single 1/4-tag.  Returns TRUE if the center
  1479.       two people are in a right-handed miniwave.  Returns FALSE if they
  1480.       are in a left-handed miniwave.  One live person in the center is
  1481.       sufficient to make the test.  Raises an error if the centers are
  1482.       both phantoms or they are not in a miniwave.  This predicate is
  1483.       unusual in that it does not look specifically at the person under
  1484.       test.  It evaluates the setup as a whole.
  1485.  
  1486. trngl_pt_rh
  1487.       Applies to a triangle.  This is strict relative to the point.
  1488.       Returns TRUE if the triangle point is as if in a right-handed triangle
  1489.       (independently of the existence or facing direction of the base people).
  1490.       Returns FALSE if the triangle point is as if in a left-handed triangle.
  1491.       Raises an error if the point is a phantom or is facing toward or
  1492.       away from the base.  This predicate is unusual in that it does not
  1493.       look specifically at the person under test.  It evaluates the setup
  1494.       as a whole.
  1495.  
  1496. Still to do:
  1497.  
  1498. q_tag_front
  1499.       Applies to a qtag only.  (Remember that we use the term "qtag"
  1500.       independently of actual facing direction -- it applies to 3/4 tags,
  1501.       1/4-lines, diamonds, etc.  Part of the purpose of this predicate
  1502.       is to distinguish among these cases.)  This is strict relative to the
  1503.       people it tests.  For a person in the center line, this returns TRUE
  1504.       if the subject's partner is alive and facing in the opposite direction,
  1505.       and FALSE otherwise.  That is, it performs a strict test for the
  1506.       subject being in a miniwave, which presumably means the setup is a
  1507.       1/4-tag as opposed to a 1/4-line.  For a person on the outside,
  1508.       this returns TRUE only if the two people in the center line who are
  1509.       closest to the subject are both alive and in a miniwave with each
  1510.       other, and the end of that line is facing the subject.  It returns
  1511.       FALSE otherwise.  For example, for an outside beau in a 1/4-tag or
  1512.       1/4-line, it returns TRUE only if the setup is a left-handed 1/4-tag,
  1513.       and FALSE if it is right-handed or is a 1/4-line.  It only examines
  1514.       the two center people close to the subject (the ones in the subject's
  1515.       single 1/4-tag) in making this determination.  When applying the test
  1516.       to an outside, the subject's own facing direction is not important.
  1517.       For example, in a right-hand 3/4-tag, this will return TRUE for an
  1518.       outside beau and FALSE for an outside belle.  In diamonds of any
  1519.       consistent handedness, this returns TRUE for a trailing point and
  1520.       FALSE for a leading point.
  1521.  
  1522. q_tag_back
  1523.  
  1524.  
  1525.  
  1526. q_line_front
  1527. q_line_back
  1528.  
  1529.                            APPENDIX B -- ESCAPE CODES IN CALL NAMES
  1530.  
  1531.                   These are not in a particularly logical order.
  1532.  
  1533. @0        - for call with mandatory substitution (e.g. "clover and ...") put
  1534.                       subcall here.
  1535. @1        - put optional subcall here.
  1536. @2 ... @3 - text to remove and replace with subcall.  Like @4 ... @5 along with @1.
  1537. @4 ... @5 - text to remove if optional substitution has been made.
  1538. @6        - put selector here.
  1539. @7 ... @8 - text to ADD if optional substitution has been made, as in the "ing"
  1540.                       for "fascinating <anything>".
  1541. @9        - put number here.
  1542. @a        - put number here, expressed as N/4, but say "full" instead of 4/4.
  1543. @b        - put number here, expressed as N/4.
  1544. @c ... @d - text to remove if this call was invoked with a "must_be_tag_call"
  1545.                       substitution.
  1546. @e ... @f - text to change to "left" if this call has "left" modifier.
  1547.                       Must use @g also if this appears.
  1548. @g        - at beginning of call name: an @e...@f sequence will occur.
  1549. @h        - at beginning of call name: if this is invoked with "single"
  1550.                       concept, change to "single file".
  1551. @i        - at beginning of call name: an @j...@l sequence will occur.
  1552. @j ... @l - text to add if this call has "cross" modifier.  Presumably
  1553.                       has the word "cross" in it.
  1554.                       Must use @i also if this appears.
  1555. @k        - put selector here, but use singular name, as in "beau tie".
  1556.